from django.db import models

# Create your models here.
class Guide(models.Model):
    guide_id = models.AutoField(primary_key=True, verbose_name="引导员编号")
    guide_state = models.CharField(max_length=1, verbose_name="引导人员状态")
    guide_frequency = models.IntegerField(verbose_name='引导人员次数')
    guide_name = models.CharField(max_length=20, verbose_name='引导人员姓名')
    guide_gender = models.CharField(max_length=1, verbose_name='引导员性别', help_text="m为男，f为女，n为空")
    guide_tel = models.CharField(max_length=11,verbose_name='引导人员电话')
    guide_remarks = models.CharField(max_length=50, blank=True, null=True, verbose_name='引导人员备注')

    def __str__(self):
        return self.guide_name

    class Meta:
        db_table = 'guide'
        verbose_name = "引导员"
        verbose_name_plural = verbose_name


class Account(models.Model):
    account_id = models.AutoField(primary_key=True, verbose_name="账号编号")
    account_username = models.CharField(max_length=20, unique=True, verbose_name="账号")
    account_pwd = models.CharField(max_length=128, verbose_name="账号密码")
    account_state = models.CharField(max_length=1,null=True, blank=True, verbose_name="账号状态")

    def __str__(self):
        return self.account_username

    class Meta:
        db_table = 'account'
        verbose_name = "账号列表"
        verbose_name_plural = verbose_name


class Room(models.Model):
    room_id = models.AutoField(primary_key=True, verbose_name="房间编号")
    room_name = models.CharField(max_length=20, unique=True, verbose_name="房间号")
    room_position = models.CharField(max_length=20, verbose_name="房间位置")
    room_size = models.CharField(max_length=20, verbose_name="房间大小（几人间）")
    room_state = models.CharField(max_length=1, verbose_name="房间状态")
    room_time = models.DateTimeField(max_length=20, blank=True, null=True, verbose_name="房间占用时长")
    room_remarks = models.CharField(max_length=50, null=True, blank=True, verbose_name="房间备注")

    def __str__(self):
        return self.room_name

    class Meta:
        db_table = 'room'
        verbose_name = "房间信息"
        verbose_name_plural = verbose_name


class State(models.Model):
    state_id = models.AutoField(primary_key=True, verbose_name="前台人员编号")
    state_user = models.CharField(max_length=20, unique=True, verbose_name="前台人员账号")
    state_pwd = models.CharField(max_length=32, verbose_name="前台人员密码")
    state_name = models.CharField(max_length=20, verbose_name="前台人员姓名")
    state_gender = models.CharField(max_length=1, verbose_name='前台人员性别', help_text="m为男，f为女，n为空")
    state_tel = models.IntegerField(verbose_name='前台人员电话')
    state_remarks = models.CharField(max_length=50, blank=True, null=True, verbose_name='前台人员备注')

    def __str__(self):
        return self.state_name

    class Meta:
        db_table = 'state'
        verbose_name = "前台人员信息"
        verbose_name_plural = verbose_name
